﻿
CREATE PROCEDURE [dbo].[SYS_Provider_GetList]
(
	@ProviderTypeId  int,
	@Status int
)

AS

IF(@Status=0)
BEGIN

	SELECT 		
		p.[ProviderId],
		p.[ProviderTypeId],
		p.[Name],
		p.[Description],
		p.[ConfigurationControlPath],
		p.[Status]
	    FROM dbo.SYS_Provider p
		WHERE p.ProviderTypeId=@ProviderTypeId
		ORDER BY p.UpdateDate DESC

END
IF(@Status>0)
BEGIN

	SELECT 		
		p.[ProviderId],
		p.[ProviderTypeId],
		p.[Name],
		p.[Description],
		p.[ConfigurationControlPath],
		p.[Status]
	    FROM dbo.SYS_Provider p
		WHERE p.[Status]=@Status AND p.ProviderTypeId=@ProviderTypeId
		ORDER BY p.UpdateDate DESC
		
END

